<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui"%>
<jsp:include page="../include/header.jsp" />
<script type="text/javaScript">
<!--
	function viewPage(id) {
		$('#scs_area_key').val(id);
		$('#pageIndex').val("1");
		$('#listForm').attr('action', '<c:url value="/currentSystem/currentSystemList.do"/>');
		$('#listForm').submit();		
	}

	/* pagination 페이지 링크 function */
	function paging(pageNo){
		$('#pageIndex').val(pageNo);
		$('#listForm').attr('action', '<c:url value="/currentSystem/currentServiceareaList.do"/>');
		$('#listForm').submit();
	}
	
	function searchForm(){
		$('#pageIndex').val('1');
		$('#listForm').attr('action', '<c:url value="/currentSystem/currentServiceareaList.do"/>');
		$('#listForm').submit();
	}

-->
</script>
<div class="container" id="container">
	<span class="round lt">&nbsp;</span>
    <span class="round rt">&nbsp;</span>
    <span class="round lb">&nbsp;</span>
    <span class="round rb">&nbsp;</span>
    <div class="container_area">
    <form name="listForm" id="listForm" method="post" action="<c:url value='/currentSystem/currentServiceareaList.do'/>">
		<input type="hidden" name="pageIndex" id="pageIndex" value="${serviceareaVO.pageIndex }"/>
		<input type="hidden" name="scs_area_key" id="scs_area_key" />
        <h2 class="tit_h2">시설현황 목록</h2>
        <jsp:include page="../include/navi.jsp" />
        <div class="srch_wrap">
			<fieldset>
				<legend>키워드 검색 조회 영역</legend>
				<label for="searchCodeKey">권역</label>
				<select id=searchCodeKey name="searchCodeKey" title="권역 검색" onchange="searchForm();">
					<option value="">전체</option>
					<c:forEach var="result" items="${zoneList }"  varStatus="status">
						<option value="${result.scc_code_key }" <c:if test="${result.scc_code_key eq serviceareaVO.searchCodeKey}">selected="selected"</c:if>>${result.scc_code_name}[${result.scc_zone_aname }]</option>
					</c:forEach>		
				</select>
				<label for="searchKeyword">현장명</label>
				<input type="text" title="검색영역" id="searchKeyword" name="searchKeyword" class="input_srch" value="${serviceareaVO.searchKeyword }"/>
				<a href="<c:url value='/currentSystem/currentServiceareaList.do'/>" onclick="searchForm();return false;" class="btn_srch">검색</a>
			</fieldset>
		</div>
        <div class="table_wrap"><!-- D : table은 div table_wrap 싸고감 -->
        	<table summary="시설현황 목록입니다" class="table_list">
            	<caption>시설현황 목록</caption>
                <colgroup>
                	<col width="15%" /> <!-- D : col width로 테이블 넓이 조절 -->
                    <col width="15%" />
                    <col width="*" />
                    <col width="35%" />
                </colgroup>
                <thead>
                	<tr>
                    	<th scope="col">번호</th>
                        <th scope="col">권역</th>
                        <th scope="col">현장명</th>
                        <th scope="col">담당자</th>
                    </tr>
                </thead>
                <tbody>
                <c:forEach var="result" items="${resultList}" varStatus="status">
				<tr>
					<td>${(serviceareaVO.rowNum)-(status.count-1)}</td>
					<td>${result.scc_zone_aname}</td>
					<td><a href="<c:url value="/currentSystem/currentSystemList.do"/>?scs_area_key=${result.ssa_area_key}" onclick="viewPage('${result.ssa_area_key}');return false;"><c:out value="${result.ssa_area_name}"/></a>&nbsp;</td>
					<td>${result.ssa_admin_name}/${result.ssa_admin_hp}</td>
				</tr>
				</c:forEach>
				<c:if test="${empty resultList}">
					<tr>
						<td colspan="4">데이터가 없습니다.</td>
					</tr>
				</c:if>
                </tbody>
            </table>
        </div>
    	<div class="paging">
			<ui:pagination paginationInfo="${serviceareaVO}" type="image" jsFunction="paging" />
		</div>
	</form>
    </div>
</div>
<jsp:include page="../include/footer.jsp" />